# -*- coding: utf-8 -*-

from adb import AdbTool
import constant


def test_adb():
    adb = AdbTool()
    adb.open_adb()
    if adb.is_opened():
        print('adb is opened')
        print('do swipe test')
    else:
        print('adb is not opened')
        print('exit')
        return

    adb.screen_cap('cvtest.png')

    adb.set_operation_range(90, 920, 900, 900)
    input('press any key, to left')
    adb.user_swipe(constant.SWIPE_LEFT)
    input('press any key, to down')
    adb.user_swipe(constant.SWIPE_DOWN)
    input('press any key, to right')
    adb.user_swipe(constant.SWIPE_RIGHT)
    input('press any key, to up')
    adb.user_swipe(constant.SWIPE_UP)


if __name__ == '__main__':
    test_adb()
